﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>链接</title>
    <link href="../../../Scripts/easyUI145/themes/icon.css" rel="stylesheet" type="text/css" />
    <link href="../../../Scripts/easyUI145/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../../../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
    <script src="../../../Scripts/easyUI145/jquery.min.js" type="text/javascript"></script>
    <script src="../../../Scripts/easyUI145/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../../../Scripts/QueryString.js" type="text/javascript"></script>
    <script src="../../../Scripts/config.js" type="text/javascript"></script>
    <script src="../../../Scripts/QueryString.js" type="text/javascript"></script>
    <script src="../../../Comm/Gener.js" type="text/javascript"></script>
    <script src="DDLBar.js" type="text/javascript"></script>
    <script src="../../EnumLab.js"></script>
    <script src="../../../Admin/Admin.js"></script>

    <script type="text/javascript">
        $(function () {

            //  InitBar(0);

            InitBar(MethodModel.Link);

        });

        function Save() {

            $("#Msg").html("正在创建,请稍后......");

            var name = $("#TB_Name").val();
            if (name == undefined || name == null || name == "") {
                alert("请输入方法名称.");
                return;
            }

            var en = new Entity("BP.CCBill.Template.Method");

            en.FrmID = GetQueryString("FrmID");
            en.GroupID = GetQueryString("GroupID"); //分组ID.
            en.MethodID = "LinkOnSearchBar";
            en.Mark = "LinkOnSearchBar";

            en.Name = name;
            en.MethodModel = MethodModel.Link; //设置为链接按钮.
            en.RefMethodType = 1;
            en.UrlExt = $("#TB_Url").val();
            en.Tag1 = $("#TB_Url").val();
            en.Icon = "icon-drop";
            en.WorkWhere = 1; //在集合里使用.
            en.IsEnable = 1;
            en.Insert();

            var url = "../../../Comm/En.htm?EnName=BP.CCBill.Template.MethodLink&No=" + en.No;
            SetHref(url);
        }

        function GenerPinYin() {

            //是否是全拼.
            var isQuanPin = 0;
            if (document.getElementById("RB_ZZMM_0").checked == true)
                isQuanPin = 1;

            // var name = $('#TB_Nam').val();
            var name = document.getElementById("TB_Name").value;
            if (name == "")
                return;

            var handler = new HttpHandler("BP.WF.HttpHandler.Admin_CCFormDesigner");
            handler.AddPara("IsQuanPin", isQuanPin);
            handler.AddPara("TB_Name", encodeURIComponent(name));
            var data = handler.DoMethodReturnString("NewFrmGuide_GenerPinYin");

            $("#Msg").html("");

            if (data.indexOf('err@') >= 0) {
                $("#Msg").html("<font color=red>" + data + "</font>");
                return;
            }

            $('#TB_No').val(data);

        }
    </script>
</head>
<body>
    <div id="bar">
    </div>

    <fieldset>
        <legend>链接或者按钮</legend>
        <table>
            <tr>
                <td>标签:比如(打开百度) </td>
                <td>  <input type="text" value="" id="TB_Name" name="TB_Name" /></td>
                <td>要打开的Url</td>
                <td>
                    <input type="text" value="" id="TB_Url" name="TB_Url" />
                </td>
            </tr>
        </table>

        <legend> 帮助</legend>
        <ul>
            <li> 用于解决不能实现的对实体的操作个性化较强的功能。 </li>
            <li> 比如：您输入的url为:  http://ccbpm.cn/MyUrl.htm </li>
            <li> 系统将解析为: http://ccbpm.cn/MyUrl.htm?WorkID=xxxx&FrmID=xxxx&UserNo=xxxx&Token=xxxx </li>
            <li> 该链接显示在查询工具栏上。 </li>
        </ul>
        <legend> 帮助</legend>

        <img src="Link.png" class="HelpImg" />
        <!--<input type="button" id="Btn_Save" name="Btn_Save" value="执行创建" onclick="Save();" />-->
        <div id="Msg"></div>
    </fieldset>


</body>
</html>
